package com.bed.lovewithpatientbed.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * malfunction
 * @author 
 */
public class Malfunction implements Serializable {
    private Integer malfunctionId;

    private Integer bedId;

    private Integer malfunctionTypeId;

    private String malfunctionInfor;

    private Integer hospitalId;

    private Integer deptId;

    private Integer malfunctionStateId;

    private Integer bedStatusId;

    private Integer employeeId;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date malfunctionDate;

    private Integer softdel;

    private BedPut bedPut;

    private MalfunctionType malfunctionType;

    private MalfunctionState malfunctionState;

    private Hospital hospital;

    private Dept dept;

    private Employee employee;

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    public BedPut getBedPut() {
        return bedPut;
    }

    public void setBedPut(BedPut bedPut) {
        this.bedPut = bedPut;
    }

    public MalfunctionType getMalfunctionType() {
        return malfunctionType;
    }

    public void setMalfunctionType(MalfunctionType malfunctionType) {
        this.malfunctionType = malfunctionType;
    }

    public MalfunctionState getMalfunctionState() {
        return malfunctionState;
    }

    public void setMalfunctionState(MalfunctionState malfunctionState) {
        this.malfunctionState = malfunctionState;
    }

    public Hospital getHospital() {
        return hospital;
    }

    public void setHospital(Hospital hospital) {
        this.hospital = hospital;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    private static final long serialVersionUID = 1L;

    public Integer getMalfunctionId() {
        return malfunctionId;
    }

    public void setMalfunctionId(Integer malfunctionId) {
        this.malfunctionId = malfunctionId;
    }

    public Integer getBedId() {
        return bedId;
    }

    public void setBedId(Integer bedId) {
        this.bedId = bedId;
    }

    public Integer getMalfunctionTypeId() {
        return malfunctionTypeId;
    }

    public void setMalfunctionTypeId(Integer malfunctionTypeId) {
        this.malfunctionTypeId = malfunctionTypeId;
    }

    public String getMalfunctionInfor() {
        return malfunctionInfor;
    }

    public void setMalfunctionInfor(String malfunctionInfor) {
        this.malfunctionInfor = malfunctionInfor;
    }

    public Integer getHospitalId() {
        return hospitalId;
    }

    public void setHospitalId(Integer hospitalId) {
        this.hospitalId = hospitalId;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public Integer getMalfunctionStateId() {
        return malfunctionStateId;
    }

    public void setMalfunctionStateId(Integer malfunctionStateId) {
        this.malfunctionStateId = malfunctionStateId;
    }

    public Integer getBedStatusId() {
        return bedStatusId;
    }

    public void setBedStatusId(Integer bedStatusId) {
        this.bedStatusId = bedStatusId;
    }

    public Integer getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(Integer employeeId) {
        this.employeeId = employeeId;
    }

    public Date getMalfunctionDate() {
        return malfunctionDate;
    }

    public void setMalfunctionDate(Date malfunctionDate) {
        this.malfunctionDate = malfunctionDate;
    }

    public Integer getSoftdel() {
        return softdel;
    }

    public void setSoftdel(Integer softdel) {
        this.softdel = softdel;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Malfunction other = (Malfunction) that;
        return (this.getMalfunctionId() == null ? other.getMalfunctionId() == null : this.getMalfunctionId().equals(other.getMalfunctionId()))
            && (this.getBedId() == null ? other.getBedId() == null : this.getBedId().equals(other.getBedId()))
            && (this.getMalfunctionTypeId() == null ? other.getMalfunctionTypeId() == null : this.getMalfunctionTypeId().equals(other.getMalfunctionTypeId()))
            && (this.getMalfunctionInfor() == null ? other.getMalfunctionInfor() == null : this.getMalfunctionInfor().equals(other.getMalfunctionInfor()))
            && (this.getHospitalId() == null ? other.getHospitalId() == null : this.getHospitalId().equals(other.getHospitalId()))
            && (this.getDeptId() == null ? other.getDeptId() == null : this.getDeptId().equals(other.getDeptId()))
            && (this.getMalfunctionStateId() == null ? other.getMalfunctionStateId() == null : this.getMalfunctionStateId().equals(other.getMalfunctionStateId()))
            && (this.getBedStatusId() == null ? other.getBedStatusId() == null : this.getBedStatusId().equals(other.getBedStatusId()))
            && (this.getEmployeeId() == null ? other.getEmployeeId() == null : this.getEmployeeId().equals(other.getEmployeeId()))
            && (this.getMalfunctionDate() == null ? other.getMalfunctionDate() == null : this.getMalfunctionDate().equals(other.getMalfunctionDate()))
            && (this.getSoftdel() == null ? other.getSoftdel() == null : this.getSoftdel().equals(other.getSoftdel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMalfunctionId() == null) ? 0 : getMalfunctionId().hashCode());
        result = prime * result + ((getBedId() == null) ? 0 : getBedId().hashCode());
        result = prime * result + ((getMalfunctionTypeId() == null) ? 0 : getMalfunctionTypeId().hashCode());
        result = prime * result + ((getMalfunctionInfor() == null) ? 0 : getMalfunctionInfor().hashCode());
        result = prime * result + ((getHospitalId() == null) ? 0 : getHospitalId().hashCode());
        result = prime * result + ((getDeptId() == null) ? 0 : getDeptId().hashCode());
        result = prime * result + ((getMalfunctionStateId() == null) ? 0 : getMalfunctionStateId().hashCode());
        result = prime * result + ((getBedStatusId() == null) ? 0 : getBedStatusId().hashCode());
        result = prime * result + ((getEmployeeId() == null) ? 0 : getEmployeeId().hashCode());
        result = prime * result + ((getMalfunctionDate() == null) ? 0 : getMalfunctionDate().hashCode());
        result = prime * result + ((getSoftdel() == null) ? 0 : getSoftdel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", malfunctionId=").append(malfunctionId);
        sb.append(", bedId=").append(bedId);
        sb.append(", malfunctionTypeId=").append(malfunctionTypeId);
        sb.append(", malfunctionInfor=").append(malfunctionInfor);
        sb.append(", hospitalId=").append(hospitalId);
        sb.append(", deptId=").append(deptId);
        sb.append(", malfunctionStateId=").append(malfunctionStateId);
        sb.append(", bedStatusId=").append(bedStatusId);
        sb.append(", employeeId=").append(employeeId);
        sb.append(", malfunctionDate=").append(malfunctionDate);
        sb.append(", softdel=").append(softdel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}